<template>
    <div>
        <div>
            <!-- 卡片 -->
            <el-card class="box-card">
                <el-row>
                    <el-col v-for="item in list" :key="item.id">
                        <p class="theme" >
                            {{ item.title }}
                        </p>
                        <p class="details">
                            {{ stripTag(item.content) }}
                        </p>
                    </el-col>
                </el-row>
            </el-card>
        </div>
    </div>

</template>

<script>

export default {
    props: {
        list: Array,
    },
    methods: {
        stripTag(content) {
            // 去掉标签，return出去
            // content是字符串，字符串替换是replace方法
            return content.replace(/<[^>]+>/g, '');
        }
    }
}
</script>

<style scoped>
.theme {
    font-size: 20px;
    font-weight: bold;
    margin-left: -15px;
}

.details {
    line-height: 30px;
    font-size: 16px;
}

.box-card {
    /* width: 480px; */
    margin-bottom: 10px;

}
</style>